package com.xwj.entity;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;

import java.io.Serializable;
import java.util.UUID;

/**
 * Created by xuweijie on 2018/1/18.
 */
public class RaHourseInfo implements Serializable {
    private static final long serialVersionUID = -7116167719129080098L;
    private String id;
    private String userId;//房东Id(发布者)
    private String phone;
    private int cloudId;//云图Id;
    private String detailInfo;//详细信息
    private String expireTime;//过期时间
    private String createTime;//创建时间
    private int status;//状态
    private String del_flag; //删除标志
    private String statusStr;
    private HouseInfoDetailEntity houseInfoDetailEntity; //房屋详情实体

    public RaHourseInfo() {
    }

    public RaHourseInfo(String userId, String phone, int cloudId, int expireTime, String detailInfo) {
        this.id = UUID.randomUUID().toString().replaceAll("-", "");
        this.userId = userId;
        this.phone = phone;
        this.cloudId = cloudId;
        this.createTime = new DateTime().toString("yyyy-MM-dd HH:mm:ss");
        this.expireTime = DateTime.parse(createTime, DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss")).plusDays(expireTime).toString("yyyy-MM-dd HH:mm:ss");
        this.detailInfo = detailInfo;
        this.status = 2;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getCloudId() {
        return cloudId;
    }

    public void setCloudId(int cloudId) {
        this.cloudId = cloudId;
    }

    public String getDetailInfo() {
        return detailInfo;
    }

    public void setDetailInfo(String detailInfo) {
        this.detailInfo = detailInfo;
    }

    public String getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(String expireTime) {
        this.expireTime = expireTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDel_flag() {
        return del_flag;
    }

    public void setDel_flag(String del_flag) {
        this.del_flag = del_flag;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public HouseInfoDetailEntity getHouseInfoDetailEntity() {
        return houseInfoDetailEntity;
    }

    public void setHouseInfoDetailEntity(HouseInfoDetailEntity houseInfoDetailEntity) {
        this.houseInfoDetailEntity = houseInfoDetailEntity;
    }

    @Override
    public String toString() {
        return "RaHourseInfo{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", phone='" + phone + '\'' +
                ", cloudId=" + cloudId +
                ", detailInfo='" + detailInfo + '\'' +
                ", expireTime='" + expireTime + '\'' +
                ", createTime='" + createTime + '\'' +
                ", status=" + status +
                ", del_flag='" + del_flag + '\'' +
                ", statusStr='" + statusStr + '\'' +
                '}';
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }
}
